package com.addedstuff;

import brianchen.util;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;

public class Flamethrower extends ItemSword {
	public Flamethrower(int par1, EnumToolMaterial par2EnumToolMaterial) {
		super(par1, par2EnumToolMaterial);
		this.setCreativeTab(CreativeTabs.tabCombat);
		// TODO Auto-generated constructor stub

	}

	public void registerIcons(IconRegister iconReg) {
		itemIcon = iconReg.registerIcon("Brianmodbase:Flamethrower");
	}

	public int getDamageVsEntity(Entity par1Entity) {
		return 1000;
	}
//will spawn fire for 100 block in the direction the user is looking
	public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) 
	{
		if (!par2World.isRemote)
		{
			
			for(int x = 0; x < 100; x++)
			{
				Vec3 vec = util.placeInFrontOfEntity(par3EntityPlayer, 2+x);
				par2World.setBlock((int)vec.xCoord,(int) vec.yCoord ,(int) vec.zCoord , Block.fire.blockID);
			}

		}
		return par1ItemStack;
	}
}
